import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import HomePage from '../pages/home'
import SagaPage from '../pages/saga'
import CounterPage from '../pages/counter'
import SearchPage from '../pages/search';
import DetailPage from '../pages/detail';
import NotFoundPage from '../pages/notFound';
import ShoppingCart from '../pages/shopping-cart'

export default class Routes extends Component {
  render() {
    return (
      <Router>
        <Switch>
          <Route exact path="/" component={HomePage}></Route>
          <Route path="/saga" component={SagaPage}></Route>
          <Route path="/counter" component={CounterPage}></Route>
          <Route path='/cart' component={ShoppingCart}></Route>
          <Route path="/search/:type" component={SearchPage}></Route>
          <Route path="/detail/:id" component={DetailPage}></Route>
          <Route path="*" component={NotFoundPage}></Route>
        </Switch>
      </Router>
    )
  }
}
